package com.yf.tz.service;

import com.yf.service.BaseService;
import com.yf.tz.entity.MallOrderEntity;
import com.yf.tz.vo.MallCartVo;
import com.yf.tz.vo.MallOrderVo;
import com.yf.tz.vo.OrderCommitVo;
import com.yf.tz.vo.res.CommitOrderRes;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;

/**
 * 订单Service接口
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Wed Jul 01 16:32:18 CST 2020
 */
public interface MallOrderService extends BaseService<MallOrderEntity> {



     List<MallOrderVo> queryListVo(MallOrderVo mallOrderVo);

     MallOrderVo getVo(Long id);

    /***********BACK***********/

    /***********API***********/

    /**
     * 提交订单
      * @param userId
     * @param addressId
     * @param payWay
     * @param items
     * @return
     */
    CommitOrderRes commitOrder(Long userId, OrderCommitVo orderCommitVo, HttpServletRequest request);


    //继续支付
    String rePay(Long userId,Long id);

    /**
     * 取消订单
     * @param userId
     * @param orderId
     * @return
     */
   MallOrderEntity  cancelOrder(Long userId,Long orderId);

    /**
     * 找到某人的订单
     * @param userId
     * @return
     */
   List<MallOrderVo> findByUserId(Long userId,Integer paid,Integer status, Integer page,Integer limit);

    /**
     * 通过订单号查找
     * @param orderNo
     * @return
     */
   MallOrderEntity findByOrderNo(String orderNo);

   void downLoad(HttpServletResponse response,List<MallOrderEntity> list);

   void downLoadSend(HttpServletResponse response);

   void resetWaitSend();

    void upload(InputStream file);

    void afterPay(MallOrderEntity orderEntity);

}
